<?php

namespace app\common\model;

class DingtalkAttendance extends _Model
{
    public function getSourceTypeAttr($value)
    {
        $maps = [
            'ATM' => '考勤机',
            'BEACON' => 'IBeacon',
            'DING_ATM' => '钉钉考勤机',
            'USER' => '用户打卡',
            'BOSS' => '老板改签',
            'APPROVE' => '审批系统',
            'SYSTEM' => '考勤系统',
            'AUTO_CHECK' => '自动打卡',
        ];
        return $maps[$value];
    }

    public function getCheckTypeAttr($value)
    {
        $maps = [
            'OnDuty' => '上班',
            'OffDuty' => '下班'
        ];
        return $maps[$value];
    }

    public function getTimeResultAttr($value)
    {
        $maps = [
            'Normal' => '正常',
            'Early' => '早退',
            'Late' => '迟到',
            'SeriousLate' => '严重迟到',
            'Absenteeism' => '旷工迟到',
            'NotSigned' => '未打卡',
        ];
        return $maps[$value];
    }

    public function getLocationResultAttr($value)
    {
        $maps = [
            'Normal' => '范围内',
            'Outside' => '范围外',
            'NotSigned' => '未打卡'
        ];
        return $maps[$value];
    }
}